import request from '@/utils/request'

export function postCustomerFind(data) {
  return request({
    url: `/api/order/customer/find`,
    method: 'post',
    data
  })
}

export function postOrderFind(data) {
  return request({
    url: `/api/order/find`,
    method: 'post',
    data
  })
}

export function postOrderDeduct(orderSn,data) {
  return request({
    url: `/api/order/${orderSn}/deduct?orderSn=${orderSn}`,
    method: 'post',
    data
  })
}

export function postOrderRefund(orderSn,data) {
  return request({
    url: `/api/order/${orderSn}/refund?orderSn=${orderSn}`,
    method: 'post',
    data
  })
}

export function postOrderStatus(orderSn,data) {
  return request({
    url: `/api/order/${orderSn}/status`,
    method: 'post',
    data
  })
}

export function postOrder(data) {
  return request({
    url: `/api/order`,
    method: 'post',
    data
  })
}

export function getOrder(orderSn) {
  return request({
    url: `/api/order/${orderSn}?orderSn=${orderSn}`,
    method: 'get'
  })
}

export function putOrder(orderSn,data) {
  return request({
    url: `/api/order/${orderSn}`,
    method: 'put',
    data
  })
}